load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")
load("@bazel_gazelle//:def.bzl", "gazelle")

# gazelle:prefix github.com/iceber/iouring-go
gazelle(name = "gazelle")

go_library(
    name = "iouring-go",
    srcs = [
        "errors.go",
        "eventfd.go",
        "fixed_buffers.go",
        "fixed_files.go",
        "iouring.go",
        "link_request.go",
        "mmap.go",
        "options.go",
        "poller.go",
        "prep_request.go",
        "probe.go",
        "request.go",
        "timeout.go",
        "types.go",
        "user_data.go",
        "utils.go",
    ],
    importpath = "github.com/iceber/iouring-go",
    visibility = ["//visibility:public"],
    deps = select({
        "@io_bazel_rules_go//go/platform:android": [
            "//syscall",
            "@org_golang_x_sys//unix:go_default_library",
        ],
        "@io_bazel_rules_go//go/platform:linux": [
            "//syscall",
            "@org_golang_x_sys//unix:go_default_library",
        ],
        "//conditions:default": [],
    }),
)

go_test(
    name = "iouring-go_test",
    srcs = ["iouring_test.go"],
    embed = [":iouring-go"],
)
